<template>
  <el-row>
    <el-col :span="22" :offset="1">

      <!--卡片shart-->
      <el-card class="box-card" style="padding: 0 15px;">

        <el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="line-height: 40px">
          <!--药品调价-->
          <el-tab-pane label="药品调价" name="first" >
            <div  style="width: 100%;margin: auto">
              <el-row :gutter="24">
                <el-col :span="6" style="line-height: 40px"><div class="grid-content bg-purple">
                  处方类别
                  <el-select v-model="druginfo.kind" filterable placeholder="请选择">
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                      <span style="float: left">{{ item.label }}</span>
                      <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                    </el-option>
                  </el-select>
                </div></el-col>
                <el-col :span="8" style="line-height: 40px"><div class="grid-content bg-purple">
                  <el-input placeholder="请输入内容" v-model="input_search" class="input-with-select">
                    <el-button slot="append" icon="el-icon-search"></el-button>
                  </el-input>
                </div></el-col>
              </el-row>
            </div>
            <div>
              <el-table
                :data="druginfo"
                :header-cell-style="{background:'#C2C5F6',color:'#0a0a0d','text-align':'center',}"
                style="width: 100%;"
                :cell-style="{'text-align':'center'}">

                <el-table-column
                  type="index"
                  width="50">
                </el-table-column>

                <el-table-column
                  prop="drugId"
                  label="编号"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="name"
                  label="药品名称"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="kind"
                  label="处方类别"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="specification"
                  label="规格"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="formulation"
                  label="剂型"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="manufacturer"
                  label="生产厂家"
                  width="180">
                </el-table-column>

                <el-table-column label="操作">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)">调价</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="block">
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[5, 10, 15, 20]"
                  :page-size="10"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="10">
                </el-pagination>
              </div>
            </div>
          </el-tab-pane>


          <!--调价记录-->
          <el-tab-pane label="调价记录" name="second">
            <div  style="width: 100%;margin: auto">
              <el-row :gutter="24">
                <el-col :span="6" style="line-height: 40px"><div class="grid-content bg-purple">
                  处方类别
                  <el-select v-model="druginfo.kind" filterable placeholder="请选择">
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                      <span style="float: left">{{ item.label }}</span>
                      <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
                    </el-option>
                  </el-select>
                </div></el-col>
                <el-col :span="8" style="line-height: 40px"><div class="grid-content bg-purple">
                  <el-input placeholder="请输入内容" v-model="input_search" class="input-with-select">
                    <el-button slot="append" icon="el-icon-search"></el-button>
                  </el-input>
                </div></el-col>
              </el-row>
            </div>
            <div>
              <el-table
                :data="druginfo"
                :header-cell-style="{background:'#C2C5F6',color:'#0a0a0d','text-align':'center',}"
                style="width: 100%;"
                :cell-style="{'text-align':'center'}">>
                <el-table-column
                  type="index"
                  width="50">
                </el-table-column>

                <el-table-column
                  prop="drugId"
                  label="编号"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="name"
                  label="药品名称"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="kind"
                  label="处方类别"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="specification"
                  label="规格"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="formulation"
                  label="剂型"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="manufacturer"
                  label="生产厂家"
                  width="180">
                </el-table-column>

                <el-table-column
                  prop="cishu"
                  label="调价次数"
                  width="180">
                </el-table-column>

                <el-table-column label="操作">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)">查看详情</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="block">
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[5, 10, 15, 20]"
                  :page-size="10"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="10">
                </el-pagination>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>

      </el-card>
      <!--卡片end-->

    </el-col>
  </el-row>
</template>

<script>
  export default {
    data() {
      return {
        options: [{
          value: '选项1',
          label: '全部'
        }, {
          value: '选项2',
          label: '西/成药'
        }, {
          value: '选项3',
          label: '中药'
        }],
        input_search: '',
        druginfo:[],
        currentPage4: 4,
        activeName: 'first',
      }
    },
    methods:{
      addOne(){
        alert("xinzeng")
      },
      handleClick(tab, event) {
        console.log(tab, event);
      },
      //分页
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      /*调价*/
      handleDelete(index, row) {
        console.log(index, row);
        this.$router.push("/drugAdjustPriceSon1")
      },
      //查看详情
      handleEdit(index, row) {
        console.log(index, row);
        this.$router.push("/drugAdjustPriceSon2")
      },

      findAll:function () {
        this.druginfo=[{
          drugId:1111,
          name:1111,
          kind:1111,
          classify:1111,
          specification:1111,
          formulation:1111,
          invoice:1111,
          permitNo:1111,
          manufacturer:1111,
          isOtc:1111,
          status:1111,
          time:'2019-02-09 10:23:56',
          packingUnit:1111,
          factor:1111,
          units:1111,
          doseFactor:1111,
          doseUnit:1111,
          purchasePrice:1111,
          retailPrice:1111,
          attribute1:1111,
          attribute2:1111,
          cishu:3
        }]
      }
    },
    mounted(){
      this.findAll();
    }
  }
</script>

<style>
  .el-row {
    margin-bottom: 20px;
  &:last-child {
     margin-bottom: 0;
   }
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: white;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
</style>


